package com.lc.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class com.lc.utils.R
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {

    private Integer code;
    private String msg;
    private Object data;

    public static R ok(Object data) {
        return new R(200, "操作成功", data);
    }

    public static R ok() {
        return new R(200, "操作成功", null);
    }

    public R(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


}
